echo off

rem port settings
set fport=12345
set bport=1234

rem install python requirements
pip install -r ./backend/requirements.txt

rem start b/f end service
start /b python -m http.server --directory ./frontend/dist %fport%
start /b python ./backend/ws_main.py %bport%

rem open browser
set code="import webbrowser;webbrowser.open('http://localhost:%fport%/?listen=%bport%', new=0, autoraise=True)"
python -c %code%

pause